package Thread_3;

public class Thread_3 {
    public static void main(String[] args) throws InterruptedException {
        T t = new T();
        System.out.println(t.getState());
        t.start();
        for (int i = 0; i < 12; i++) {
            System.out.println("main状态"+t.getState());
            Thread.sleep(1000);
        }
        System.out.println("main状态"+t.getState());
    }
}
class T extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(1500);
                System.out.println(Thread.currentThread().getName()+"状态"+Thread.currentThread().getState());
            } catch (InterruptedException e) {
               e.printStackTrace();
            }
        }
        System.out.println(Thread.currentThread().getName()+"状态"+Thread.currentThread().getState());
    }
}